#include "fcntl.h"
#include "unistd.h"
#include "stdint.h"
#include "stdio.h"

void main()
{
	int open_ret_val, write_ret_val;
	int num = 0;
	int i = 0;
	char buf[1];

	open_ret_val = open("./InputData", O_RDWR | O_CREAT | O_APPEND, 0666);
	if(-1 == open_ret_val) {
		printf("fail to open file.\n");
		exit(0);
	}

	for(; i < 65536; i++) {
		sprintf(buf, "%d", num);
		write_ret_val = write(open_ret_val,(void*)buf, 1);
		if(-1 == write_ret_val) {
			printf("Fail to write data to file.\n");
			exit(0);
		}
		num = (num + 1) % 10;
	}

	return;
}
